<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="../lib/mootools-core-1.4.5-full-compat.js" type="text/javascript"></script>
    <script src="index.js" type="text/javascript"></script>
    <script type="text/javascript">
        var ta = null;
        window.addEvent('domready', function () {
            ta = new TextArea($('chat'),{
                width:200,
                height:100,
                isReadOnly:true
            });
            $('clickMe').addEvent('click',function(){
                console.log(ta);
                ta.appendText('呵呵，点击成功\n');
            });
        });
    </script>
    <style>
        .textarea {
            outline: none;
            border: 1px solid #ccc;
            padding:10px;
        }
    </style>
</head>
<body>
<label for="chat">聊天记录</label>
<textarea name="chat" id="chat">

</textarea>
<button id="clickMe">点击我</button>
</body>
</html>